﻿<%@ Page Language="C#" MasterPageFile="~/AdminZone/AdminMaster.master" AutoEventWireup="true" CodeFile="AdminList.aspx.cs" Inherits="AdminZone_AdminList" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <div id="toolbar-box">
        <div class="m">
            <div class="pagetitle icon-adminInfo">
                <h2>
                    Danh sách quản trị</h2>
            </div>
        </div>
    </div>
    <div id="element-box">
        <div class="m">
            <div class="width-100 fltlft">
                <fieldset class="adminform">
                    <legend>Admin list</legend>
                    <%--Gridview Detail <a href="AdminDetail.aspx">CLICK TO VIEW ADMIN DETAILS</a>--%>
                    <table style="width: 100%" cellpadding="2" cellspacing="2" class="mgl-home" align="center" >
                        <colgroup>
                            <col width="150" />
                            <col width="500" />
                            <col width="150" />
                        </colgroup>
                        <tr>
                            <td colspan="3" class="bg-title-table">
                                <asp:Label ID="lblError" runat="server" ForeColor="Red" Font-Bold="true"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" style="height: 20px"></td>
                        </tr>
                        <tr>
                            <td class="title pdt-bt" align="right">Tài khoản :</td>
                            <td align="left">
                                <asp:TextBox ID="txtUsername" runat="server" Width="300px"></asp:TextBox>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td class="title pdt-bt" align="right">
                                Họ tên :
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtFullName" runat="server" Width="300px"></asp:TextBox>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td class="title pdt-bt" align="right">
                                Quyền :
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlRole" runat="server" Width="300px" 
                                    onselectedindexchanged="ddlRole_SelectedIndexChanged">
                                    <asp:ListItem Text='Chọn lựa quyền' Value="-1"></asp:ListItem>
                                    <asp:ListItem Text='Quản trị cấp cao' Value="1"></asp:ListItem>
                                    <asp:ListItem Text='Quản trị site' Value="2"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td colspan="2" align="left">
                                <asp:Button ID="btnSearch" runat="server" Text="Search" 
                                    onclick="btnSearch_Click" Width="123px" />
                                <asp:Button ID="btnReset" runat="server" Text="Clear" onclick="btnReset_Click" 
                                    Width="76px" />
                                <asp:Button ID="btnAddNew" runat="server" Text="Insert" onclick="Button1_Click" 
                                    Width="85px" />
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: left">
                                <asp:Label ID="lblResult" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                            </td>
                            <td class="left" colspan="2" style="text-align: right">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3" style="height: 399px" valign="top">
                                <asp:GridView ID="gvSearch" runat="server" CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False"
                                    GridLines="None" Width="1214px" AllowPaging="True" PageSize="15" 
                                    onpageindexchanging="gvSearch_PageIndexChanging">
                                    <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                    <RowStyle BackColor="#E3EAEB" Height="25" />
                                    <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                    <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                    <HeaderStyle BackColor="#1C5E55" Font-Bold="True" Height="30" 
                                        ForeColor="White" />
                                    <EditRowStyle BackColor="#7C6F57" />
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Delete">
                                            <HeaderTemplate>
                                                <input type="checkbox" onclick="checkAll(this,'checkDel');" />
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <input type="checkbox" name="checkDel" value='AdminID' />
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <HeaderStyle HorizontalAlign="Center" />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="AdminID" HeaderText="AdminID">
                                            <ItemStyle HorizontalAlign="center" />
                                        </asp:BoundField>
                                        <asp:HyperLinkField HeaderText="Tên truy cập" DataNavigateUrlFormatString="~/AdminZone/AdminDetail.aspx?id={0}"
                                            DataNavigateUrlFields="AdminID" DataTextField="AdminLoginName">
                                            <HeaderStyle HorizontalAlign="left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </asp:HyperLinkField>
                                        <asp:BoundField DataField="Fullname" HeaderText="Họ và tên">
                                            <HeaderStyle HorizontalAlign="left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Email" HeaderText="Email" />
                                        <asp:BoundField DataField="Address" HeaderText="Địa chỉ" />
                                        <asp:TemplateField HeaderText="Quyền">
                                            <ItemTemplate>
                                                <%# DisplayRoleName(Eval("Role")) %>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:HyperLinkField HeaderText="Edit" DataNavigateUrlFormatString="~/AdminZone/AdminDetail.aspx?id={0}"
                                            DataNavigateUrlFields="AdminID" Text="Edit">
                                            <HeaderStyle HorizontalAlign="left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </asp:HyperLinkField>
                                    </Columns>
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: left">
                                <asp:Button ID="btnDelete" runat="server" Text="Delete" Width="100px" OnClientClick="return isChecked('checkDel');"
                                    ToolTip="Click here to delete items" onclick="btnDelete_Click" />
                            </td>
                            <td class="left" colspan="2" style="text-align: right">
                            </td>
                        </tr>
                    </table>

                    <script src="../Js/Common.js" type="text/javascript"></script>

                </fieldset>
            </div>
            <div class="clr" />
        </div>
    </div>
</asp:Content>

